package org.qiyu.live.gateway;

import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * @Program qiyu-live-user-provider
 * @Description 网关服务
 * @Author tangfh
 * @Create 2024-07-01 10:53
 **/
@SpringBootApplication
@EnableDiscoveryClient
@EnableDubbo
public class GatewayApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(GatewayApplication.class);
        springApplication.setWebApplicationType(WebApplicationType.REACTIVE);
        springApplication.run(args);
    }

    @Value("${qiyu.http.headers.ACCESS_CONTROL_ALLOW_ORIGIN}")
    private String ACCESS_CONTROL_ALLOW_ORIGIN;

    @Override
    public void run(String... args) throws Exception {
        System.out.println("ACCESS_CONTROL_ALLOW_ORIGIN 允许跨域地址: " + ACCESS_CONTROL_ALLOW_ORIGIN);
    }
}
